package com.fowo.api.sys.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.fowo.api.sys.entity.SysRoleData2;
import com.fowo.api.sys.model.SysRoleData2Map;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 系统角色数据权限表-版本2 Mapper
 * @author yl_ls
 */
@Mapper
public interface SysRoleData2Mapper extends BaseMapper<SysRoleData2> {

    List<SysRoleData2> selectList(@Param("roleId") Long roleId, @Param("groupId") Long groupId);
    List<SysRoleData2> selectFast(@Param("roleId") Long roleId, @Param("groupId") Long groupId);

    List<SysRoleData2> selectListByRoleIdAndTargetType(@Param("roleId") Long roleId, @Param("targetType") String targetType);

    void batchDelete(@Param("ids") List<Long> ids);

    void batchInsert(@Param("list") List<SysRoleData2> inserted);

    List<Long> selectVisibleUserIdsByGroupAndUserId(@Param("groupId") Long groupId, @Param("userId") Long userId);

    List<Long> selectTargetIdByTypeAndGroupAndUserId(@Param("targetType") String targetType, @Param("groupId") Long groupId, @Param("userId") Long userId);

    List<String> selectVisibleFieldAuthByUserId(@Param("userId") Long userId);

    boolean selectExistsFuncAndUserId(@Param("funcKey") String funcKey, @Param("userId") Long userId);
}
